﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Commons
{
    [Serializable]
    public class Node
    {
        PointF _point;
        public string ID { get; set; }
        public float X
        {
            get { return this._point.X; }
            set { this._point.X = value; }
        }
        public float Y
        {
            get { return this._point.Y; }
            set { this._point.Y = value; }
        }
        public Node(Point point, string Id):this(point.X,point.Y,Id)
        {
        }
        public Node(float x, float y, string Id)
        {
            this._point = new PointF(x, y);
            this.ID = Id;
        }
        //Override the ToString method: 
        public override string ToString()
        {
            return String.Format("{0} X = {2}, Y = {3}, ID = {4} {1}", " {", "} ", X, Y, ID);
        }
        public static implicit operator PointF(Node rhs)
        {
            return rhs._point;
        }
    }
}
